﻿#include <iostream>
#include <time.h>
using namespace std;

int main()
{
    const int N = 10;
    struct tm buf;
    time_t t = time(NULL);
    localtime_s(&buf, &t);
    int WorkLine = buf.tm_mday % N;
    int Array[N][N];
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < N; j++)
        {
            Array[i][j] = i + j;
        }
    }
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < N; j++)
        {
            cout << Array[i][j] << " ";
        }
        cout << "\n";
    }
    int Result = 0;
    for (int i = 0; i < N; Result += Array[WorkLine][i++]);
    cout << "Sum for line " << WorkLine << " is " << Result << "\n";
}
